package com.ccl.iot.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SqlOpenHelper extends SQLiteOpenHelper {

    private final String mTableName;
    private final String mSql;

    public SqlOpenHelper(Context context, String name, String tableName, String sql) {
        super(context, name, null, 1);
        mTableName = tableName;
        mSql = sql;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
//        db.execSQL("create table if not exists " + mTableName + mSql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

    @Override
    public void onOpen(SQLiteDatabase db) {
        db.execSQL("create table if not exists " + mTableName + mSql);
    }
}
